async function hook($req = request, $resp = response, $modules = modules) {
  let dingTalkApi = $modules.dingTalkApi;
  let helper = $modules.helper;
  //用于验证钉钉回调
  let token = await helper.getConfig("token");
  let aesKey = await helper.getConfig("aesKey");
  let corpid = await helper.getConfig("corpid");
  let { timestamp, nonce } = $req.query;
  let result = dingTalkApi.instanceCrypto({
    token,
    encodingAESKey: aesKey,
    CorpId: corpid,
    timestamp,
    nonce,
  });
  $resp.body = result;

  //加密信息
  let encrypt = $req.body.encrypt;
  if (encrypt) {
    let msg = await dingTalkApi.msgCrypt.decrypt(encrypt);
    if (msg.message) {
      //解密后钉钉数据 data
      let data = JSON.parse(msg.message);
    }
  }
}
